写一个注册页面，用于注册用户
<template>
  <div class="login">
    <div class="login-content">
      <div class="login-content-input">
        <input type="text" placeholder="请输入手机号" v-model="phone" />
      </div>
      <div class="login-content-input">
        <input type="text" placeholder="请输入验证码" v-model="yanzhengmanum" />
      </div>
      <div class="login-content-input">
        <input type="text" placeholder="请输入密码" v-model="password" />
      </div>
      <div class="login-content-input">
        <input type="text" placeholder="请再次输入密码" v-model="password2" />
      </div>
      <div class="login-content-btn" @click="yanzhengma">获取验证码</div>
      <div class="login-content-btn" @click="login">注册</div>
      <div class="login-content-other">
        <span>忘记密码</span>
        <span>注册</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
const store = useStore();
const router = useRouter();
const phone = ref("");
const password = ref("");
const password2 = ref("");
const yanzhengmanum = ref("");
const login = async (res) => {
  console.log(res);
  const reg = /^1[3456789]\d{9}$/;
  if (reg.test(phone.value)) {
    if (password.value == password2.value) {
      await store.dispatch("register", {
        phone: phone.value,
        yanzhengmanum: yanzhengmanum.value,
        password: password.value,
        passwords: password2.value,
      });
    } else {
      alert("两次密码输入不一致");
    }
    if (store.state.code === 0) {
      console.log(store.state.code);
      uni.navigateTo({
        url: "/pages/login/login",
      });
    }
  } else {
    alert("手机号格式不正确");
    return false;
  }
};
//获取验证码
const yanzhengma = async () => {
  const reg = /^1[3456789]\d{9}$/;
  if (reg.test(phone.value)) {
    await store.dispatch("loginVerificationcode", phone.value);
    console.log(store.state.Verificationcode);
  } else {
    alert("手机号格式不正确");
    return false;
  }
};
</script>

<style lang="scss" scoped>
.login {
  width: 100%;
  height: 100%;
  background: #fff;
}

.login-content {
  width: 100%;
  height: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  .login-content-input {
    width: 100%;
    height: 50px;
    border-bottom: 1px solid #ccc;
    input {
      width: 100%;
      height: 100%;
      border: none;
      outline: none;
      font-size: 16px;
    }
  }
  .login-content-btn {
    width: 100%;
    height: 50px;
    background: #ff464e;
    color: #fff;
    text-align: center;
    line-height: 50px;
    border-radius: 5px;
    margin-top: 20px;
  }
  .login-content-other {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    span {
      color: #ff464e;
    }
  }
}
</style>
